package me.huha.commons.email;

/**
 * @Title: ProtocolEnum.java
 * @Author: Yepx
 * @mail: yepx2013@gmail.com
 * @CreateTime: 2017年6月16日 下午1:54:17
 * @Todo: email 通信协议枚举
 */
public enum ProtocolEnum {
   
	SMTP("smtp"), POP3("pop3"), IMAP("imap");
	
	private ProtocolEnum(String desc) {
		this.desc = desc;
	}
	private String desc;

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static ProtocolEnum getProtocolEnum(String desc) {
		for (ProtocolEnum enums : ProtocolEnum.values()) {
			if (enums.getDesc().equals(desc)) {
				return enums;
			}
		}
		return null;
	}
}
